package andrei.mower2.main.i18n;

import java.text.MessageFormat;
import java.util.ResourceBundle;

public class MessageUtils {

	private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle("messages");
	
	public static String getMessage(String key, Object... params) {
		if(params == null) {
			return RESOURCE_BUNDLE.getString(key);
		} else {
			return MessageFormat.format(RESOURCE_BUNDLE.getString(key), params);
		}
	}

	public static ResourceBundle getResourceBundle() {
		return RESOURCE_BUNDLE;
	}	
}
